#--
公用左边部分引用
--#
<div class="fly-panel" style="margin-bottom: 0;">

    <!--<div class="fly-panel-title fly-filter">-->
    <!--<a href="" class="layui-this">综合</a>-->
    <!--<span class="fly-mid"></span>-->
    <!--<a href="">未结</a>-->
    <!--<span class="fly-mid"></span>-->
    <!--<a href="">已结</a>-->
    <!--<span class="fly-mid"></span>-->
    <!--<a href="">精华</a>-->
    <!--<span class="fly-filter-right layui-hide-xs">-->
    <!--<a href="" class="layui-this">按最新</a>-->
    <!--<span class="fly-mid"></span>-->
    <!--<a href="">按热议</a>-->
    <!--</span>-->
    <!--</div>-->

    #if(topArticleList.size() > 0)
    <ul class="fly-list">

        #for(article:topArticleList)
        <li>
            <a href="/article/#(article.url == '' ? 'id-'+article.id:article.url)" class="fly-avatar">
                <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg"
                     alt="#(article.user.name)">
            </a>
            <h2>
                <!--<a class="layui-badge">分享</a>-->
                <a href="/article/detail/#(article.url == '' ? 'id-'+article.id:article.url)">#(article.title)</a>
            </h2>


            <div class="fly-list-info">
                <a href="/user/home.html" link>
                    <cite>#(article.user.name == null ? article.user.name : article.user.nike_name )</cite>
                    <!--<i class="iconfont icon-renzheng" title="认证信息：XXX"></i>-->
                    <!--<i class="layui-badge fly-badge-vip">VIP3</i>-->
                </a>
                <span>#date(article.create_time)</span>

                <!--<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span>-->
                <!--<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>-->
                <span class="fly-list-nums">
                <!--<i class="iconfont icon-pinglun1" title="回答"></i> 66-->
              </span>
            </div>
            <div class="fly-list-badge">
                <span class="layui-badge layui-bg-black">置顶</span>
                #if(article.is_quintessence ?? == 'on')
                <span class="layui-badge layui-bg-red">精帖</span>
                #end
            </div>
        </li>
        #end


        #for(article:articlePage.list)
        <li>
            <a href="/article/#(article.url == '' ? 'id-'+article.id:article.url)" class="fly-avatar">
                <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg"
                     alt="#(article.user.name)">
            </a>
            <h2>
                <!--<a class="layui-badge">分享</a>-->
                <a href="/article/detail/#(article.url == '' ? 'id-'+article.id:article.url)">#(article.title)</a>
            </h2>
            <div class="fly-list-info">
                <a href="/user/home.html" link>
                    <cite>#(article.user.name == null ? article.user.name : article.user.nike_name )</cite>
                    <!--<i class="iconfont icon-renzheng" title="认证信息：XXX"></i>-->
                    <!--<i class="layui-badge fly-badge-vip">VIP3</i>-->
                </a>
                <span>#date(article.create_time)</span>

                <!--<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span>-->
                <!--<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>-->
                <span class="fly-list-nums">
                <!--<i class="iconfont icon-pinglun1" title="回答"></i> 66-->
              </span>
            </div>
            <div class="fly-list-badge">
                #if(article.is_quintessence ?? == 'on')
                <span class="layui-badge layui-bg-red">精帖</span>
                #end
            </div>
        </li>

        #end
    </ul>
    #else
    <div class="fly-none">没有相关数据</div>
    #end

    <!--分页-->
    <div style="text-align: center">
        <div id="articlePage"></div>
    </div>

</div>


<script>

    layui.use(['laypage'], function () {
        var laypage = layui.laypage;


        var articleCount = "#(articleCount)";

        //region 分页回调
        laypage.render({
            elem: 'articlePage'
            , count: "#(articlePage.totalRow)" //数据总数，从服务端得到
            , limit: "#(limit)" //每页显示条数
            , curr: "#(pageIndex)" //获取起始页
            , jump: function (obj, first) {
                //obj包含了当前分页的所有参数，比如：
                console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                console.log(obj.limit); //得到每页显示的条数

                //首次不执行
                if (!first) {
                    location.href = '/article/' + obj.curr;
                }
            }
        });
        //endregion

    });

</script>

